package frontend.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import frontend.controller.MainFrameController;
import frontend.view.MainFrame;

public class MainActionListener implements ActionListener {

	private MainFrame frame = MainFrame.getInstance();

	@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == frame.getCreate()) {
			MainFrameController.getInstance().create();
		} else if (e.getSource() == frame.getUpdate()
				|| e.getSource() == frame.getUpdatePopup()) {
			MainFrameController.getInstance().update();
		} else if (e.getSource() == frame.getDelete()
				|| e.getSource() == frame.getDeletePopup()) {
			MainFrameController.getInstance().delete();
		}
	}

}
